﻿#ifndef _OI_PLSCANNERCORE_PROFILESCHART_HPP_
#define _OI_PLSCANNERCORE_PROFILESCHART_HPP_

#include <QtCharts\QChart>
#include <QtCharts\QLineSeries>
#include <QtCharts\QSplineSeries>
#include <QtCharts\QScatterSeries>
#include <QList>
#include <QPointF>

#include "PLScannerCore/OiPLScannerCore.hpp"

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API ProfilesChart : public QtCharts::QChart
        {
            Q_OBJECT
        public:
            ProfilesChart(QGraphicsItem *parent = Q_NULLPTR, Qt::WindowFlags wFlags = Qt::WindowFlags());
            virtual ~ProfilesChart();

        signals:
            void frame(const OiProfiles profiles);

        public:
            void updateProfiles(const OiProfiles& profiles);

            void updateProfiles(const OiProfile& profile, double connectionThreshold = 0, double linkingThreshold = 0, double noiseThreshold = 0);
            
            QList<QPointF> profiles();

            void clearAllSeries();

            void autoRange(double percentage = 0.8, QPointF center = QPointF());

        private:
            OI_DISABLE_COPY(ProfilesChart);
            OI_DECLARE_IMPL(ProfilesChart);
        };

    }
}

#endif